var dbConfig = require('../utils/dbconfig')
// 获取用户信息
getUserInfo = (req,res) => {
    var sql = "select * from base_user";
  var sqlArr = [];
  var callBack = (err, data) => {
    if (err) {
      console.log("连接出错了");
    } else {
      res.send({
        list: data
      });
    }
  };

  dbConfig.sqlConnection(sql,sqlArr,callBack)
}

// 获取指定的部门id下的子部门
getDepartment = (req,res) => {
    let {id} = req.query;
    var sqlArr = [id]
    var sql = `select * from base_department where parent_id=?`;
    var callBack = (err, data) => {
        if (err) {
          console.log("连接出错了");
        } else {
          res.send({
            list: data
          });
        }
      };
    dbConfig.sqlConnection(sql,sqlArr,callBack)
}
module.exports = {
    getUserInfo,getDepartment
}